package com.swt.domain;

import javax.persistence.*;

@Entity
public class Classroom {
    private int classroomId;
    private String classroomName;
    private String classroomCapacity;
    private int classroomShopId;

    private Shop shop;
    private Integer clubClubId;

    @ManyToOne(targetEntity = Shop.class)
    @JoinColumn(name = "classroom_shop_id",referencedColumnName = "shopid")
    public Shop getShop() {
        return shop;
    }

    public void setShop(Shop shop) {
        this.shop = shop;
    }

    @Id
    @Column(name = "classroom_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public int getClassroomId() {
        return classroomId;
    }

    public void setClassroomId(int classroomId) {
        this.classroomId = classroomId;
    }

    @Basic
    @Column(name = "classroom_name")
    public String getClassroomName() {
        return classroomName;
    }

    public void setClassroomName(String classroomName) {
        this.classroomName = classroomName;
    }

    @Basic
    @Column(name = "classroom_capacity")
    public String getClassroomCapacity() {
        return classroomCapacity;
    }

    public void setClassroomCapacity(String classroomCapacity) {
        this.classroomCapacity = classroomCapacity;
    }

    @Basic
    @Column(name = "clubClubId")
    public Integer getClubClubId() {
        return clubClubId;
    }

    public void setClubClubId(Integer clubClubId) {
        this.clubClubId = clubClubId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Classroom classroom = (Classroom) o;

        if (clubClubId != null ? !clubClubId.equals(classroom.clubClubId) : classroom.clubClubId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return clubClubId != null ? clubClubId.hashCode() : 0;
    }
}
